package com.ulife.permission.common;

import org.apache.commons.lang.StringUtils;

public class PagePermissionConstants {

	public static final String LOGIN = "/login";
	
	public static final String LOGOUT = "/logout";
	
	public static final String ULIFE_CONTROLLER = "/ulifeController";
	
	public static final String MODIFY_PASSWORD = "/modifyPassword";
	
	public static final String USER_LIST = "/userList";

	public static final String USER_INFO = "/userInfo";
	
	public static final String ROLE_LIST = "/roleList";

	public static final String ROLE_INFO = "/roleInfo";
	
	public static final String DEPARTMENT_LIST = "/departmentList";

	public static final String DEPARTMENT_INF = "/departmentInfo";
	
	public static final String ERROR = "/error";

	public static final String NO_PERMISSION = "/noPermission";
	
	public static final String CATE_LIST = "/catelist";
	
	public static final String INDEX = "/index";
	
	public static final String MESSAGE = "/message";
	
	public static final String PROPERTY_LIST = "/propertylist";
	
	public static final String ITEM_LIST = "/itemlist";

	public static final String SUPPLIER_LIST = "/supplierlist";
	
	public static final String USER_LIST_ID = "userlist";
	
	public static final String USER_INFO_ID = "userinfo";
	
	public static final String ROLE_LIST_ID = "rolelist";

	public static final String ROLE_INFO_ID = "roleinfo";
	
	public static final String DEPARTMENT_LIST_ID = "departmentlist";
	
	public static final String CATE_LIST_ID = "catelist";
	
	public static final String PROPERTY_LIST_ID = "propertylist";
	
	public static final String ITEM_LIST_ID = "itemlist";
	
	public static final String SUPPLIER_LIST_ID = "supplierlist";
	
	public static final String SONG_LIST = "/songList";
	
	public static boolean isDontNeedAccess(String target) {
		if (StringUtils.equals(target, LOGIN) 
				|| StringUtils.endsWith(target, ERROR)
				|| StringUtils.endsWith(target, MODIFY_PASSWORD)
				|| StringUtils.endsWith(target, LOGOUT)
				|| StringUtils.endsWith(target, INDEX)
				|| StringUtils.endsWith(target, MESSAGE)
				|| StringUtils.endsWith(target, ULIFE_CONTROLLER)
				|| StringUtils.endsWith(target, SONG_LIST)
				|| StringUtils.endsWith(target, NO_PERMISSION)) {
			return true;
		}
		return false;
	}
	
}
